home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 4 / boot-disc-1996-12.iso / Apps / Cakewalk / PROAUD5 / AD.1 / Thin Pitch Wheel.cal < prev    next >
Text File  |  1996-06-18  |  889b  |  40 lines

  1. ;; Thin Pitch Wheel.cal
  2. ;; A CAL program to "thin" pitch wheel data.
  3. ;;
  4. ;; Deletes every N'th pitch wheel event unless the wheel value is
  5. ;; is -8191, 0, or 8191 (min, center, and max values, respectively).
  6.  
  7. (do
  8.     (include "need20.cal")    ; Require version 2.0 or higher of CAL
  9.  
  10.     (int N 4)    ; thin every N'th event
  11.     (int i 0)        ; index for moving through
  12.  
  13.     (getInt N "Delete every Nth wheel event:" 1 100 )
  14.  
  15.     (forEachEvent
  16.         (if (== Event.Kind WHEEL)
  17.             (do
  18.                 (switch Wheel.Val
  19.                     ; If -8192, 0, or 8192, don't delete
  20.                     0
  21.                         NIL
  22.                     -8192
  23.                         NIL
  24.                     8191
  25.                         NIL
  26.  
  27.                     Wheel.Val        ;default
  28.                         (if (== (% i N) 0)           ; Is it the N'th event?
  29.                             (do
  30.                                 (delete)                ; Yes: delete it
  31.                                 (message "Deleted #" i) ; Let 'em know how it's going
  32.                             )
  33.                         )
  34.                 )
  35.                 (++ i) ; this counts
  36.             )
  37.         )
  38.     )
  39. )
  40.